
open Lexer
open Parser

(* A des fins de test *)
let print_token t =
	let toString = function
		| TLBrace				-> "TLBrace"
		| TRBrace				-> "TRBrace"
		| TLPar					-> "TLPar"
		| TRPar					-> "TRPar"
		| TLBracket 			-> "TLBracket"
		| TRBracket				-> "TRBracket"
		| TDot					-> "TDot"
		| TSemiColon			-> "TSemiColon"
		| TComma				-> "TComma"
		| TLChevron				-> "TLChevron"
		| TRChevron				-> "TRChevron"
		| TLEqual				-> "TLEqual"
		| TGEqual				-> "TGEqual"
		| TNEqual				-> "TNEqual"
		| TDblEqual				-> "TDblEqual"
		| TTrplEqual			-> "TTrplEqual"
		| TNDblEqual			-> "TNDblEqual"
		| TArrow				-> "TArrow"
		| TPlus					-> "TPlus"
		| TMinus				-> "TMinus"
		| TTimes				-> "TTimes"
		| TDiv					-> "TDiv"
		| TMod					-> "TMod"
		| TIncrement			-> "TIncrement"
		| TDecrement			-> "TDecrement"
		| TPreIncrement			-> "TPreIncrement"
		| TPreDecrement			-> "TPreDecrement"
		| TLDblChevron			-> "TLDblChevron"
		| TRDblChevron			-> "TRDblChevron"
		| TRTrplChevron			-> "TRTrplChevron"
		| TAmp					-> "TAmp"
		| TPipe					-> "TPipe"
		| TCaret				-> "TCaret"
		| TNot					-> "TNot"
		| TTilde				-> "TTilde"
		| TAnd					-> "TAnd"
		| TOr					-> "TOr"
		| TOperator s			-> "TOperator : " ^ s
		| TPostOperator s		-> "TPostOperator : " ^ s
		| TQuestion				-> "TQuestion"
		| TColon				-> "TColon"
		| TEqual				-> "TEqual"
		| TPlusEqual			-> "TPlusEqual"
		| TMinusEqual			-> "TMinusEqual"
		| TTimesEqual			-> "TTimesEqual"
		| TModEqual				-> "TModEqual"
		| TLDblChevronEqual		-> "TLDblChevronEqual"
		| TRDblChevronEqual		-> "TRDblChevronEqual"
		| TRTrplChevronEqual	-> "TRTrplChevronEqual"
		| TAmpEqual				-> "TAmpEqual"
		| TCaretEqual			-> "TCaretEqual"
		| TDivEqual				-> "TDivEqual"
		| TPipeEqual			-> "TPipeEqual"
		| TRegex (s1, s2)		-> "TRegex : " ^ s1 ^ " flags : " ^ s2
		| TNumber num			-> "TNumber : " ^ num
		| TIdentifier s			-> "TIdentifier : " ^ s
		| TString s				-> "TString : " ^ s
		| TNewLine				-> "TNewLine"
		| _						-> "Keyword"
	in
		print_string (toString t);
		print_newline ()
